<template>
  <footer class="footer">
    <span class="todo-count"
      >剩余<strong>{{ farr.length }}</strong></span
    >
    <ul class="filters" @click="fn">
      <li>
        <a
          :class="{ selected: isSel === 'all' }"
          href="javascript:;"
          @click="isSel = 'all'"
          >全部</a
        >
      </li>
      <li>
        <a
          href="javascript:;"
          @click="isSel = 'no'"
          :class="{ selected: isSel === 'no' }"
          >未完成</a
        >
      </li>
      <li>
        <a
          href="javascript:;"
          @click="isSel = 'yes'"
          :class="{ selected: isSel === 'yes' }"
          >已完成</a
        >
      </li>
    </ul>
    <button class="clear-completed" @click="clear">清除已完成</button>
  </footer>
</template>

<script>
export default {
  data() {
    return {
      isSel: "all",
    };
  },
  methods: {
    fn() {
      this.$emit("shai", this.isSel);
    },
    clear() {
      this.$emit("clefn");
    },
  },
  props: ["farr"],
};
</script>